const cloud = require('wx-server-sdk')
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV })
const db = cloud.database()

exports.main = async (event, context) => {
  const { data } = await db.collection('moneyMap').where({ openid: event.openid }).get()
  return data[0]
}
